import 'package:flutter/material.dart';

class TextCase extends StatelessWidget {
  const TextCase({super.key});
  @override
  Widget build(BuildContext context) {
    return Container(
     width: 200,
     decoration: const BoxDecoration(
      color: Colors.red,
     ),
     child: const Text('一首诗的名字\n白居易\n离离原上草, 一岁一枯荣。野火烧不尽，春风吹又生。\n野火烧不尽，春风吹又生。\n野火烧不尽，春风吹又生。\n野火烧不尽，春风吹又生。',
     style: TextStyle(
      //颜色
      color: Colors.white,
      //字体大小
      fontSize: 20,
      //行高
      height: 2,
      //字体粗细
      fontWeight: FontWeight.bold,
      //字体倾斜
      fontStyle: FontStyle.italic,
      //下划线
      decoration: TextDecoration.underline,
      decorationColor: Colors.white,
      //删除线
    //decoration: TextDecoration.lineThrough,
  //  decorationColor: Colors.white,
  //背景颜色
//backgroundColor: Colors.blue,

     ),
     //最大行数
     maxLines: 2,
     //超出省略号
     overflow: TextOverflow.ellipsis,
     //文字对齐方式
     textAlign: TextAlign.center,
     ),
    );
  }
}